{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf330
{\fonttbl\f0\fswiss\fcharset77 Helvetica;\f1\fswiss\fcharset77 Helvetica-Bold;}
{\colortbl;\red255\green255\blue255;}
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural

\f0\fs24 \cf0 This is a RayTracer shader. It ray traces a sphere lit with a point light.\
This shader is written in an extensible way and can be used to render more complex objects and scenes.\

\f1\b gl_FragCoord
\f0\b0  is used to cast rays from the Eye location.\

\f1\b \
discard
\f0\b0  is used to kill any fragments that do not interect the object.\
Thus lighting calculations are bypassed.\
This cuts down on the processing time for fragments that have no effect in the end.\
\
The white outline shows  the quad where the rays are casted from.\
So, one could compute the bounding volume (sphere or box) that completely comtains the object to be raytraced, then apply this shader to the bounding volume.\
This cuts down on the fragments to be processed.}